package com.lanp.native_test.config.database;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author jiangpeng
 * Created with IntelliJ IDEA.
 * Description:  动态路由数据源
 * Date: 2022-03-04 15:32:44
 */
public class RoutingDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        System.out.println("获取动态路由数据源");
        return RoutingDataSourceContext.getDataSourceRoutingKey();
    }
}
